﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Chilis.CRM.Web.CRMService;

namespace Chilis.CRM.Web.Controllers
{
    public class ClientesController : Controller
    {
        CRMServiceClient cliente = new CRMServiceClient();

        [HttpGet]
        public ActionResult TableroClientes()
        {
            return View();
        }

        [HttpPost]
        public JsonResult GenerarTablero()
        {
            var resultado = cliente.ListarClientesRFM();
            var retorno = Json(resultado);
            cliente.Close();
            return retorno;
            /*String data = "{ \"chart\": { \"caption\" : \"Analisis RFM\" , " +
                          "\"xAxisName\" : \"Variables RFM\", \"yAxisName\" : \"Valores\", \"numberPrefix\" : \"\" },\"data\" : [ "+
                         "{ \"label\" : \"Frecuency\", \"value\" : \"" + 30 + "\" },  " +
                       "{ \"label\" : \"Recency\", \"value\" : \"" + 20 + "\" }, " +
                       "{ \"label\" : \"Monetary\", \"value\" : \"" + 50 + "\" }]}"; 
            return Json(data);*/
        }


    }
}
